package day2.scaladay01

object Function {
  def m1(f:(Int, Int)=>Int, x:Int, y:Int):Int = {
    println("m1 method")
    f(x, y)
  }



  def m2 (f:((Int, Int) =>Int, Int, Int) =>Int, x:Int, y:Int, f1:(Int, Int) =>Int):Int={
      f(f1, x, y)
  }

  def main(args: Array[String]): Unit = {
    val f1 = (x:Int, y:Int) => x + y
    val f2 = (x:Int, y:Int) => x * y
    var f3 = (f:(Int, Int) =>Int, x:Int, y:Int) => f(x, y)
    val m1Return = m1(f1, 20, 299)
    println(m1Return)
    val m1Return2 = m1(f2, 20, 299)
    println(m1Return2)

    val m1Return3 = m2(f3, 20, 30, f2)
    println(m1Return3)
  }
}
